<template>
  <div class="container">
    <top-nav :toLastPath='true'>招商信息</top-nav>
    <attractList :type="show" class="attr"></attractList>
    <div class="tip" v-if="!listData">不好意思！您没发布过招商广告点击“招商广告”去发布吧！
    </div>
    <div class="add" >
      <!-- <navigator url="/pages/memberCenter/release/main?id=0">
        +招商广告
      </navigator> -->
      <div @click="toRelease">
        +招商广告
      </div>
    </div>
  </div>
</template>

<script>
import topNav from '@/components/topNav';
import attractList from '@/components/attractList'
export default {
  data () {
    return {
      show:'show',
      listData:''
    }
  },

  components: {
     attractList,
     topNav
  },

  methods: {
    async getInformation(){
      var userToken=window.localStorage.getItem('userToken')
      let res=await this.$axios('/advert/getInvitingAdvert',{params:{user_token:userToken,type:"me"}});
      this.$store.dispatch('setDataList',res.data.data)
      this.listData=res.data.data.length==0?false:true
    },
    async toRelease(){
      var userToken=window.localStorage.getItem('userToken')
      let res=await this.$axios('/cert/judCertDeta',{params:{user_token:userToken}});
      
      if(res.data.data.personal_auth==1 ||res.data.data.company_auth==1){
        this.$router.push('/me/release')
        return
      }
      this.$currency.showToast('未认证完成',1500,'fail')
      setTimeout(()=>{
        this.$router.push('/me/authentication')
        
      },2000)
    }
  },
  activated(){
    this.getInformation()
  }
}
</script>

<style scoped>
.container{width: 100%;height: 100%;}
.select{border-bottom: 3px solid #38B4DB;}
.add{width: 200px;height: 44px;line-height: 44px;text-align: center;background-image: linear-gradient(-135deg, #57D1E2 0%, #37AED6 100%);border-radius: 22px;color: #fff;margin: 20px auto;font-size: 20px;}
.tip{width: 238px;height: 51px;font-size: 17px;text-align: center;color: #8E8E93;margin:10px auto;}
.attr{
  margin-top:45px !important;
}
</style>

